package com.yy.wga.admin.service.controller;


import com.yy.wga.mp.module.admin.request.AdminIncomeWithdrawRecordAuditRequest;
import com.yy.wga.mp.module.admin.request.AdminIncomeWithdrawRecordPageRequest;
import com.yy.wga.mp.module.admin.response.AdminIncomeWithdrawRecordPageResponse;
import com.yy.wga.mp.module.income.service.IncomeWithdrawRecordService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 运营后台/用户提现记录
 *
 * @author guochao
 * @since 2024-11-12 00:27:50
 */
@RestController
@RequestMapping("admin/income/withdrawRecord")
public class AdminIncomeWithdrawRecordController {
    /**
     * 服务对象
     */
    @Resource
    private IncomeWithdrawRecordService incomeWithdrawRecordService;

    /**
     * 获取提现记录
     * @param request
     * @return
     */
    @PostMapping("page")
    public Result<PageBean<AdminIncomeWithdrawRecordPageResponse>> page(@Valid @RequestBody AdminIncomeWithdrawRecordPageRequest request) {
        PageBean<AdminIncomeWithdrawRecordPageResponse> pageBean = incomeWithdrawRecordService.pageData(request);
        return Result.success(pageBean);
    }

    /**
     * 审核
     * @param request
     * @return
     */
    @PostMapping("audit")
    public Result<Boolean> audit(@Valid @RequestBody AdminIncomeWithdrawRecordAuditRequest request) {
        incomeWithdrawRecordService.audit(request);
        return Result.success(Boolean.TRUE);
    }
}
